package com.phoenix.jsef.framework;

import java.io.Serializable;
import java.util.List;

public class PageInfo<T> implements Serializable {
	
	protected Integer pageSize = Integer.MAX_VALUE;// 每页显示的条目数量。
	protected Integer pageIndex = 1; // 页序号
	protected Integer totalCount = 0;// 总条目数
	protected Integer pageCount = 0;// 总页数
	
	private List<T> list;//对应的数据集合

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Integer getPageIndex() {
		return pageIndex;
	}

	public void setPageIndex(Integer pageIndex) {
		this.pageIndex = pageIndex;
	}

	public Integer getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(Integer totalCount) {
		this.totalCount = totalCount;
	}

	public Integer getPageCount() {
		return pageCount;
	}

	public void setPageCount(Integer pageCount) {
		this.pageCount = pageCount;
	}

	public List<T> getList() {
		return list;
	}

	public void setList(List<T> list) {
		this.list = list;
	}

	public PageInfo(Integer pageSize, Integer pageIndex, Integer totalCount, Integer pageCount, List<T> list) {
        super();
        this.pageSize = pageSize;
        this.pageIndex = pageIndex;
        this.totalCount = totalCount;
        this.pageCount = pageCount;
        this.list = list;
    }

    public PageInfo(Integer pageSize, Integer pageIndex, Integer totalCount, List<T> list) {
        super();
        this.pageSize = pageSize;
        this.pageIndex = pageIndex;
        this.totalCount = totalCount;
        this.pageCount = ((totalCount - 1) / pageSize) +1;
        this.list = list;
    }
	
	

	public PageInfo() {
		super();
	}

	@Override
	public String toString() {
		return "PageInfos [pageSize=" + pageSize + ", pageIndex=" + pageIndex + ", totalCount=" + totalCount
				+ ", pageCount=" + pageCount + ", list=" + list + "]";
	}
}